package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	index()
}

var httpUrl = "https://m.ithome.com"

func index() {
	client := http.Client{}

	req, _ := http.NewRequest("GET", httpUrl, nil)
	req.Header.Add("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36")

	resp, err := client.Do(req)

	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)

	if nil != err {
		fmt.Println(err.Error())
	}

	fmt.Println(string(body))

}
